<script src="<?php echo base_url(); ?>js/jquery.js" type="text/javascript"></script>
<script src="<?php echo base_url(); ?>js/jquery.tablesorter.min.js" type="text/javascript"></script>
<script src="<?php echo base_url(); ?>js/jquery.boxy.js" type="text/javascript"></script>
<link rel="stylesheet" href="<?php echo base_url(); ?>css/boxy.css" type="text/css" />

<style type="text/css">
A:link {text-decoration: none; color: #BCC1DD;}
A:visited {text-decoration: none; color: #BCC1DD;}
A:active {text-decoration: none}
A:hover {font-size:2430; font-weight:bold; color: #0099FF;}
</style>



<?php 
	$account = $this->session->userdata('account');
	if($this->gateway_model->check_access($account) != 'leader') {
		echo heading('Access Denied');
	}
	else {
?>

<script type="text/javascript">
	$(document).ready(function() {
		$("#mainTable").tablesorter({cancelSelection: true});
	});
</script>

<script type="text/javascript">
	function setOrder(name, order){
		form = document.getElementById('order_form');
		form.user.value = name;
		
		if(order == "user") form.order.selectedIndex = 0;
		else if(order == "admin") form.order.selectedIndex = 1;
		else form.order.selectedIndex = 0;
	}
</script>

<h1>Site Control Panel</h1>

<?php
		$tmpl = array (
        'table_open'          => '<table id="mainTable" class="tablesorter" border="6"  style="backgroud-color: #101225 ;" color="BCC1DD">',
        'heading_row_start'   => '<tr class="heading" id="table_headingstart">',
        'heading_row_end'     => '</tr>',
        'heading_cell_start'  => '<th id="table_header" class="header" style="cursor: pointer;" >',
        'heading_cell_end'    => '</th>',

        'row_start'           => '<tr id="table_rowstart">',
        'row_end'             => '</tr>',
        'cell_start'          => '<td  id="main_content">',
        'cell_end'            => '</td>',

        'row_alt_start'       => '<tr id="table_rowaltstart">',
        'row_alt_end'         => '</tr>',
        'cell_alt_start'      => '<td id="table_footer">',
        'cell_alt_end'        => '</td>',

        'table_close'         => '</table>'
        );
        
        $table_library->set_template($tmpl);

        $table_library->set_heading('Name', 'Access', 'Edit');
        echo $table_library->generate($users_table);
?>

<div id='hidden_form' style='display: none; color: black'>
<?php
	$order_list = array('user' => 'User', 'admin' => 'Admin');
	echo form_open('roster/change_order', array('id' => 'order_form'));
	echo form_hidden('user', '');
	echo form_label('Access: ') . form_dropdown('order', $order_list, set_value('order')) .br(2);
	echo form_submit('submit', 'Submit');
?>
	<input type="button" onclick="Boxy.get(this).hide();" id="order_close" value="Cancel" />
</div>
	
<?php 
	}
?>